<template>
  <span>
    <a-button :type="btnType" @click="preview">预览</a-button>
  </span>
</template>
<script>
import { FilePreview } from '@/utils/tslCommon'

export default {
  name: 'FilePreviewBtn',
  components: {},
  props: {
    btnType: {
      type: String,
      default: 'link',
      required: false,
    },
    /**/
    url: {
      type: String,
      default: '',
      required: true,
    },
  },
  data() {
    return {}
  },
  created() {},
  watch: {

  },
  methods: {
    preview() {
      console.log(this.url);
      if (this.url) {
        FilePreview(this.url);
      }
    },
  },
}
</script>
